package com.jyy.prefabricated.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jyy.prefabricated.enums.BaseTeamEnum;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
public class TrainingOrganizationStock implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    /**
     * 机构id
     */
    private Integer trainingOrganizationId;

    /**
     * 库存商品id
     */
    private Integer productId;

    /**
     * 库存名称
     */
    private String productName;

    /**
     * 库存分类
     */
    private String productCategory;

    /**
     * 库存总数
     */
    private Integer initNum;

    /**
     * 当前剩余总数
     */
    private Integer currentNum;

    /**
     * 课时
     */
    private Integer classHours;

    /**
     * 库存类型
     */
    private Integer type;


    /**
     * 售价
     */
    private BigDecimal price;

    /**
     * 简介
     */
    private String content;

    /**
     * 讲师
     */
    private String lecturer;

    /**
     * 封面
     */
    private String pic;

    private String teamCode = BaseTeamEnum.BASE.getValue();

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    //订单id
    private Integer orderId;

    //购买类型
    private Integer buyType;

    //购买数量
    private Integer buyTypeNum;

    //支付时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payTime;

    //到期时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    //是否过期
    private Boolean whetherOverdue = true;

    /**
     * 机构名称
     */
    private String trainingOrganizationName;


}